#include <bits/stdc++.h>
using namespace std;

class Solution
{
public:
    int main()
    {
        int n;
        cin >> n;
        if (n == 0)
        {
            cout << 0;
            return 0;
        }
        bool negative = false;
        if (n < 0)
        {
            negative = true;
            n = -n;
        }
        int reversed = 0;
        while (n)
        {
            reversed *= 10;
            reversed += n % 10;
            n /= 10;
        }
        if (negative)
        {
            reversed = -reversed;
        }
        cout << reversed;
        return 0;
    }
};

#ifndef __LOCAL_TEST__
int main()
{
    return Solution().main();
}
#endif